package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * excel模板字段表
 *
 * @author chenzh
 * @since 2021-02-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("EXCEL_PARAM")
@ApiModel(value = "ExcelParam对象", description = "excel模板字段表")
public class ExcelParam extends Model<ExcelParam> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "ID_", type = IdType.INPUT)
    private String id;

    @ApiModelProperty(value = "模板id")
    @TableField("EXCEL_MODEL_ID")
    private String excelModelId;

    @ApiModelProperty(value = "字段key")
    @TableField("KEY_")
    private String key;

    @ApiModelProperty(value = "标题")
    @TableField("TITLE")
    private String title;

    @ApiModelProperty(value = "父字段")
    @TableField("PARENT_KEY")
    private String parentKey;

    @ApiModelProperty(value = "默认宽度：父字段宽度根据子字段的宽度计算")
    @TableField("WIDTH")
    private Integer width;

    @ApiModelProperty(
            value =
                    "类型:default 常规 text 文本 number 数字 date 日期 datetime 日期到秒 select 单选下拉框 multiple-select 多选下拉 cascader 联级（多级）下拉")
    @TableField("CELL_TYPE")
    private String cellType;

    @ApiModelProperty(value = "小数点位数")
    @TableField("DECIMAL_PLACES")
    private Integer decimalPlaces;

    @ApiModelProperty(value = "头部字体颜色")
    @TableField("HEADER_COLOR")
    private Short headerColor;

    @ApiModelProperty(value = "数据字体颜色")
    @TableField("BODY_COLOR")
    private Short bodyColor;

    @ApiModelProperty(value = "头部背景颜色")
    @TableField("HEADER_BG_COLOR")
    private Short headerBgColor;

    @ApiModelProperty(value = "字体背景颜色")
    @TableField("BODY_BG_COLOR")
    private Short bodyBgColor;

    @ApiModelProperty(value = "数据字典字段")
    @TableField("DICT_FIELD")
    private String dictField;

    @ApiModelProperty(value = "顺序")
    @TableField("ORDER_NO")
    private Integer orderNo;

    @ApiModelProperty(value = "是否换行")
    @TableField("WRAP_TEXT")
    private String wrapText;

    @ApiModelProperty(value = "字体大小")
    @TableField("FONT_SIZE")
    private Short fontSize;

    @ApiModelProperty(value = "字体")
    @TableField("FONT_NAME")
    private String fontName;

    @ApiModelProperty(value = "边框粗细 0-13")
    @TableField("BORDER_SIZE")
    private Short borderSize;

    @ApiModelProperty(value = "边框颜色 0-64")
    @TableField("BORDER_COLOR")
    private Short borderColor;

    @ApiModelProperty(value = "创建人")
    @TableField(
            value = "CREATE_NAME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @ApiModelProperty(value = "创建时间")
    @TableField(
            value = "CREATE_TIME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @ApiModelProperty(value = "修改人")
    @TableField(
            value = "UPDATE_NAME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @ApiModelProperty(value = "更新时间")
    @TableField(
            value = "UPDATE_TIME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除标志 0 正常 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
